package model;

import java.io.Serializable;

public class ACLMessage implements Serializable {
	
	private static final long serialVersionUID = 7284519572655951007L;
	private AgentInfo sender,reciever;
	private String replyWith,inReplyTo,replyTo,ontology,protocol,encoding;
	private String language="fipa-sl";
	private String content;
	
	public ACLMessage(AgentInfo sender, AgentInfo reciever, String content) {
		super();
		this.sender = sender;
		this.reciever = reciever;
		this.content = content;
	}
	
	public ACLMessage(AgentInfo sender, AgentInfo reciever, String protocol, String content) {
		super();
		this.sender = sender;
		this.reciever = reciever;
		this.protocol = protocol;
		this.content = content;
	}
	
	public ACLMessage(AgentInfo sender, AgentInfo reciever, AgentInfo from,
			AgentInfo to, String replyWith, String inReplyTo, String replyTo,
			String ontology, String protocol, String encoding, String language,
			String content) {
		super();
		this.sender = sender;
		this.reciever = reciever;
		this.replyWith = replyWith;
		this.inReplyTo = inReplyTo;
		this.replyTo = replyTo;
		this.ontology = ontology;
		this.protocol = protocol;
		this.encoding = encoding;
		this.language = language;
		this.content = content;
	}
	public ACLMessage() {
		super();
	}
	
	
	public AgentInfo getSender() {
		return sender;
	}
	public void setSender(AgentInfo sender) {
		this.sender = sender;
	}
	public AgentInfo getReciever() {
		return reciever;
	}
	public void setReciever(AgentInfo reciever) {
		this.reciever = reciever;
	}
	public String getReplyWith() {
		return replyWith;
	}
	public void setReplyWith(String replyWith) {
		this.replyWith = replyWith;
	}
	public String getInReplyTo() {
		return inReplyTo;
	}
	public void setInReplyTo(String inReplyTo) {
		this.inReplyTo = inReplyTo;
	}
	public String getReplyTo() {
		return replyTo;
	}
	public void setReplyTo(String replyTo) {
		this.replyTo = replyTo;
	}
	public String getOntology() {
		return ontology;
	}
	public void setOntology(String ontology) {
		this.ontology = ontology;
	}
	public String getProtocol() {
		return protocol;
	}
	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}
	public String getEncoding() {
		return encoding;
	}
	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}
	public String getLanguage() {
		return language;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
	@Override
	public String toString() {
		return "ACLMessage [sender=" + sender + ",reciever=" + reciever
				+ ", content=" + content + ", protocol="+protocol+"]";
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ACLMessage other = (ACLMessage) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (encoding == null) {
			if (other.encoding != null)
				return false;
		} else if (!encoding.equals(other.encoding))
			return false;
		if (inReplyTo == null) {
			if (other.inReplyTo != null)
				return false;
		} else if (!inReplyTo.equals(other.inReplyTo))
			return false;
		if (language == null) {
			if (other.language != null)
				return false;
		} else if (!language.equals(other.language))
			return false;
		if (ontology == null) {
			if (other.ontology != null)
				return false;
		} else if (!ontology.equals(other.ontology))
			return false;
		if (protocol == null) {
			if (other.protocol != null)
				return false;
		} else if (!protocol.equals(other.protocol))
			return false;
		if (reciever == null) {
			if (other.reciever != null)
				return false;
		} else if (!reciever.equals(other.reciever))
			return false;
		if (replyTo == null) {
			if (other.replyTo != null)
				return false;
		} else if (!replyTo.equals(other.replyTo))
			return false;
		if (replyWith == null) {
			if (other.replyWith != null)
				return false;
		} else if (!replyWith.equals(other.replyWith))
			return false;
		if (sender == null) {
			if (other.sender != null)
				return false;
		} else if (!sender.equals(other.sender))
			return false;
		return true;
	}
	
	
}
